
import socket


udpserver = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)

udpserver.bind(('127.0.0.1', 8880))


while True:
    data, addr = udpserver.recvfrom(1024)

    print("收到消息:"+ data.decode('utf-8'))

    returnMsg = "收到了"

    udpserver.sendto(returnMsg.encode('utf-8'), addr)



